/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Model.BeanUltility;
import org.apache.commons.beanutils.BeanUtils;
import java.lang.reflect.InvocationTargetException;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
 *
 * @author chickencake1
 * Function : Automatically populating Bean from Client Request
 */
public class PopulateBean {
    public static void populateBeans(Object formBean,HttpServletRequest request)    
    {
        try
        {
        BeanUtils.populate(formBean,request.getParameterMap());
        }catch(Exception e){}
        
    }
    
    public static void populateBeans(Object formBean,Map requestMap)    
    {
        try
        {
        BeanUtils.populate(formBean,requestMap);
        }catch(Exception e){}
        
    }
}
